// 引入 Koa 构造函数
const Koa = require('koa');

// 创建 Web 实例
const app = new Koa();

app.use(async (ctx, next) => {
    ctx.body = '1';
    await next();
    ctx.body += '5';
});

app.use(async (ctx, next) => {
    ctx.body += '2';
    await next();
    ctx.body += '4';
});

app.use(async (ctx) => {
    ctx.body += '3';
});

// 监听端口
app.listen(3000, () => {
    console.log('Koa server listening at http://localhost:3000');
});
